package Behavior.Iterator;

import java.util.Iterator;

/**
 * Learn Java from https://www.liaoxuefeng.com/
 * 
 * @author liaoxuefeng
 */
public class Main {

	public static void main(String[] args) {
		ReverseArrayCollection<String> rarray =
				new ReverseArrayCollection<>("apple", "pear", "orange", "banana");
		for (Iterator<String> it = rarray.iterator(); it.hasNext(); ) {
			System.out.println(it.next());
		}
		for (String fruit : rarray) {
			System.out.println(fruit);
		}
	}
}
